package com.xianggu.tomcat;

import javax.servlet.Servlet;
import java.util.HashMap;
import java.util.Map;

/**
 * @author chengjy
 * @date 2025/3/7
 */
public class Context {

    private String appName;

    private Map<String, Servlet> servletMap = new HashMap<>();

    public Context(String appName) {
        this.appName = appName;
    }

    public void addServlet(String url, Servlet servlet) {
        servletMap.put(url, servlet);
    }

    public Servlet getServlet(String url) {
        return servletMap.get(url);
    }
}
